# 斐波那契数列

class Feibonaci():
    def __init__(self, count):
        self.count = count
        self.num = list()
        self.a = 0
        self.b = 1
        self.current = 0

    def __iter__(self):
        # 直接返回自己的引用
        return self
    
    def __next__(self):
        if self.current < self.count:
            ret = self.a
            self.a, self.b = self.b, self.a+self.b
            self.current += 1
            return ret
        else:
            raise StopIteration

feibonaci = Feibonaci(10)


for temp in feibonaci:
    print(temp)

